package com.itheima.mapper;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select count(*) from user")
    Integer selectCountUser();

    @Results(
            @Result(column = "create_time", property = "createTime")
    )
    @Select("select id, name, gender, create_time from user limit #{index},#{size}")
    List<User> selectLimit(Integer index, Integer size);
}
